<?php

$map = array(
    'MysqlDb'    => './freamwork/MysqlDb.class.php',
    'Factory'    => './freamwork/Factory.class.php',
    'Model'      => './freamwork/Model.class.php',
    'Controller' => './freamwork/Controller.class.php',
    'Smarty'     => './freamwork/lib/smarty/Smarty.class.php',

);

spl_autoload_register('myLoader');

function myLoader($ClassName)
{

    global $map;

    if (isset($map[$ClassName])) {

        require $map[$ClassName];

    } elseif ('Controller' == substr($ClassName, -10)) {

        require './app/Home/controller/' . $ClassName . '.class.php';
    } elseif ('Model' == substr($ClassName, -5)) {
        require './app/Home/model/' . $ClassName . '.class.php';

    }

}

$controllerName = isset($_GET['c']) ? $_GET['c'] : 'Match'; //控制器名
define('SB', $controllerName);
$methodName = isset($_GET['a']) ? $_GET['a'] : 'matchList'; //方法名
define('MMP', $methodName);
$controller = $controllerName . 'Controller';

$c = new $controller();
$c->$methodName();

// var_dump($controllerName,$controller);

//类文件controller代表

//实例化类文件
